// Import Vue
import Vue from 'vue';
//Axios
import axios from 'axios';
import VueAxios from 'vue-axios';
Vue.use(VueAxios, axios);
//axios.defaults.baseURL = 'http://39.105.207.111:8081';
axios.defaults.baseURL = 'http://localhost:8081';
//上传图片-滴滴
// import Cube from 'cube-ui';
// Vue.use(Cube);
//Vuex
import Vuex from 'vuex'
Vue.use(Vuex);
//button
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
Vue.use(MintUI)
//日期
import { DatetimePicker } from 'mint-ui';
Vue.component(DatetimePicker.name, DatetimePicker);
// Import Framework7
import Framework7 from 'framework7/framework7.esm.bundle.js';

// Import Framework7-Vue Plugin
import Framework7Vue from 'framework7-vue/framework7-vue.esm.bundle.js';

// Import Framework7 Styles
import 'framework7/css/framework7.bundle.css';

// Import Icons and App Custom Styles
import '../css/icons.css';
import '../css/app.css';
// Import App Component
import App from '../components/app.vue';

// Init Framework7-Vue Plugin
Framework7.use(Framework7Vue)

// Init App
const store = new Vuex.Store({
  state: {
    count: 0,
    apiDocInfo: {
      name: "",
      phoplenumber: "",
      idcard: "",
      room: ""
    },
    apiData: {
      startdate: "",
      enddate: "",
      day: "",
    },
    apiPrice: {
      Price: "",
      Typepay: "",
    },
    apiCreateOrder: {
      ordername: "",
      ordercontact: "",
    },
    apiCheckIn: {
      customername: "",
      type: "",
      contact: "",
    },
    apiCheckInRoom: {
      room: "",
    },
    apiUpload: {
      id: ""
    },
    apiLogin: {
      Username: "",
      Password: ""
    },
    apiGeren: {
      RealName: ""
    },
    apiCustomerAdd:{
      customername:""
    },
    ordercondition:{
      name:"",
      center:""
    }
  },
  mutations: {
    //设置apiInfo的值
    setApiInfo: (state, apiInfo) => {
      state.apiDocInfo = apiInfo
    },
    setDate: (state, apiData) => {
      state.apiData.startdate = apiData.startdate
      state.apiData.enddate = apiData.enddate
      state.apiData.day = apiData.day
    },
    setapiPrice: (state, apiPrice) => {
      state.apiPrice.Price = apiPrice.Price
      state.apiPrice.Typepay = apiPrice.Typepay
    },
    setCreateOrder: (state, apiCreateOrder) => {
      state.apiCreateOrder.ordername = apiCreateOrder.ordername
      state.apiCreateOrder.ordercontact = apiCreateOrder.ordercontact
    },
    setapiCheckIn: (state, apiCheckIn) => {
      state.apiCheckIn.customername = apiCheckIn.customername
      state.apiCheckIn.type = apiCheckIn.type
      state.apiCheckIn.contact = apiCheckIn.contact
    },
    setapiCheckInRoom: (state, apiCheckInRoom) => {
      state.apiCheckInRoom.room = apiCheckInRoom.room
    },
    setapiUpload: (state, apiUpload) => {
      state.apiUpload.id = apiUpload.id
    },
    setapiLogin: (state, apiLogin) => {
      state.apiLogin.Username = apiLogin.Username
      state.apiLogin.Password = apiLogin.Password
    },
    setapiGeren: (state, apiGeren) => {
      state.apiGeren.RealName = apiGeren.RealName
    },
    setapiCustomerAdd: (state, apiCustomerAdd) => {
      state.apiCustomerAdd.customername = apiCustomerAdd.customername
    },
    setordercondition: (state, ordercondition) => {
      state.ordercondition.name = ordercondition.name
      state.ordercondition.center=ordercondition.center
    },
    increment: state => state.count++,
    decrement: state => state.count--,
  },
})
new Vue({
  el: '#app',
  store,
  render: (h) => h(App),

  // Register App Component
  components: {
    app: App
  },
});
